package com.sc.nft.admin.rpc;

import com.sc.nft.entity.req.ExportRecordRpcRequest;
import com.sc.nft.entity.vo.ExportRecordsVO;
import com.sc.nft.service.ExportRecordsService;
import com.sc.nft.sup.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.validation.Valid;

/**
 * @author 刘国航
 * @desc
 * @since 2024/10/31 16:02
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/rpc/exportRecord")
@Api(tags = "导出RPC接口")
public class ExportRecordRpc {

    private final ExportRecordsService exportRecordsService;

    @PostMapping(value = "/record", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "导出记录", notes = "导出记录", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiIgnore
    public PageResult<ExportRecordsVO> record(@Valid @RequestBody ExportRecordRpcRequest request) {
        return PageResult.success(exportRecordsService.exportDaoRecordsList(request));
    }

}
